﻿using FU.Capstones.IMS.Web.Common;
using Navigation.Silverlight;
using Telerik.Windows.Controls;

namespace FU.Capstones.IMS.Web.Silverlight.Controls
{
    public partial class MenuControl
    {
        public MenuControl()
        {
            InitializeComponent();
        }

        private void OnChecked(object sender, System.Windows.RoutedEventArgs e)
        {
            var btnClicked = (RadRadioButton)sender;
            //GeneralManagement
            if (btnClicked == rrdWarehouseManagement)
            {
                NavigationManager.NavigateTo(WebConstants.NavigationPages.WarehouseList);
            }
            else if (btnClicked == rrdMaterialManagement)
            {
                NavigationManager.NavigateTo(WebConstants.NavigationPages.MaterialList);
            }
            else if (btnClicked == rrdProductManagement)
            {
                NavigationManager.NavigateTo(WebConstants.NavigationPages.ProductList);
            }
            //EmployeeManagement
            else if (btnClicked == rrdEmployeeManagement)
            {
                NavigationManager.NavigateTo(WebConstants.NavigationPages.EmployeeList);
            }
            else if (btnClicked == rrdEmploymentTypeManagement)
            {
                NavigationManager.NavigateTo(WebConstants.NavigationPages.EmploymentTypeList);
            }
            else if (btnClicked == rrdRoleManagement)
            {
                NavigationManager.NavigateTo(WebConstants.NavigationPages.RoleList);
            }
            //PartnerManagement
            else if (btnClicked == rrdPartnerManagement)
            {
                NavigationManager.NavigateTo(WebConstants.NavigationPages.PartnerList);
            }
            //EIManagement
            else if (btnClicked == rrdEIPManagement)
            {
                NavigationManager.NavigateTo(WebConstants.NavigationPages.ProductOrderList);
            }
            else if (btnClicked == rrdEIMManagement)
            {
                NavigationManager.NavigateTo(WebConstants.NavigationPages.MaterialOrderList);
            }
        }
    }
}
